﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LevenBlog.Core.Entities;
using LevenBlog.Core.Utils;

namespace LevenBlog.Core.Data
{
    public interface IBlog
    {
        int Count(IDbProvider provider, BlogState selectState);

        int CountFromCategoryID(IDbProvider provider, int categoryid, BlogState selectState);

        int CountFromSearchTitle(IDbProvider provider, string searchString, BlogState selectState);

        int CountFromSearchTags(IDbProvider provider, string searchTags, BlogState selectState);

        int CountFromDateTime(IDbProvider provider, DateTime startTime, DateTime endTime, BlogState selectState);

        int CountFromUser(IDbProvider provder, string postuser, BlogState selectState);

        void AddHits(IDbProvider provider, int id, int num);

        void AddCommentNum(IDbProvider provider, int id, int num);

        void AddTrackNum(IDbProvider provider, int id, int num);

        void Insert(IDbProvider provider, lb_blog blog);

        void Update(IDbProvider provider, lb_blog blog);

        void Delete(IDbProvider provider, int id);

        void DeleteFromCategoryID(IDbProvider provider, int categoryid);

        void DeleteFromDateTime(IDbProvider provider, DateTime startTime, DateTime endTime);

        lb_blog Get(IDbProvider provider, int id);

        IList<lb_blog> Get(IDbProvider provider, int pageSize, int currentPage, BlogState selectState);

        IList<lb_blog> Get(IDbProvider provider, int categoryid, int pageSize, int currentPage, BlogState selectState);

        IList<lb_blog> Get(IDbProvider provider, DateTime startTime, DateTime endTime, int pageSize, int currentPage, BlogState selectState);

        IList<lb_blog> SearchFromTitle(IDbProvider provider, string searchString, int pageSize, int currentPage, BlogState selectState);

        IList<lb_blog> SearchFromTags(IDbProvider provider, string searchTags, int pageSize, int currentPage, BlogState selectState);

        IList<lb_blog> GetFromUser(IDbProvider provider, string postuser, int pageSize, int currentPage, BlogState selectState);

        IList<lb_blog> GetFromCategory(IDbProvider provider, int categoryid);

        Pair<lb_blog, lb_blog> GetAbout(IDbProvider provider, int id);

        IList<int> GetWriteDays(IDbProvider provider, int year, int month);
    }
}
